import os.path
import time
import unittest
import datetime
from HTMLTestRunner import  HTMLTestRunner
from testcase.test_OA import Testcase_login
from common.dir_config import report, testcase_url

if __name__ == '__main__':
    suit=unittest.TestSuite()
    loade=unittest.TestLoader()
    testscase=suit.addTest(loade.discover(start_dir=testcase_url,pattern='test*.py'))
    now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    report=os.path.join(report,now+"_rport.html")
    with open(report,"w") as htmlf:
        runner=HTMLTestRunner.HTMLTestRunner(stream=htmlf,title='oa自动化测试',description='测试用力的描述')
        runner.run(suit)

